package graduation.utils;

import graduation.vo.ResultVO;

public class ResultVOUtil {
	
	
	public static ResultVO<?> success(String msg, Object data) {
        ResultVO<Object> resultVO = new ResultVO<Object>();
        resultVO.setCode(200);
        resultVO.setMsg(msg);
        resultVO.setData(data);
        return resultVO;
    }
	public static ResultVO<?> isEmpty() {
		ResultVO<?> resultVO = new ResultVO<Object>();
		resultVO.setCode(200);
		resultVO.setMsg("无订单");
		resultVO.setData(null);
		return resultVO;
	}
	public static ResultVO<?> deleteOrder() {
		ResultVO<?> resultVO = new ResultVO<Object>();
		resultVO.setCode(200);
		resultVO.setMsg("删除已经订单");
		resultVO.setData(null);
		return resultVO;
	}
	public static ResultVO<?> fail() {
		ResultVO<?> resultVO = new ResultVO<Object>();
		resultVO.setCode(400);
		resultVO.setMsg("失败");
		resultVO.setData(null);
		return resultVO;
	}
	public static ResultVO<String> feedback() {
		ResultVO<String> resultVO = new ResultVO<String>();
		resultVO.setCode(400);
		resultVO.setMsg("反馈成功");
		resultVO.setData("谢谢你的反馈，我们会努力做得更好");
		return resultVO;
	}
	
	
//-------------------------jianlong
    public static ResultVO<Object> success(Object object) {
        ResultVO<Object> resultVO = new ResultVO<Object>();
        resultVO.setData(object);
        resultVO.setCode(200);
        resultVO.setMsg("成功");
        return resultVO;
    }

    public static ResultVO<?> success() {
        return success();
    }
	public static ResultVO<String> fail(String string) {
		ResultVO<String> resultVO = new ResultVO<String>();
		resultVO.setCode(400);
		resultVO.setMsg("失败");
		resultVO.setData(string);
		return resultVO;
	}

	
	
}
